package com.api.z001;

import net.sf.json.JSONObject;
import weaver.conn.RecordSet;
import weaver.general.Util;
import weaver.general.BaseBean;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;


/**
 * @program: ecology_erdos
 * @description:
 * @author: zm
 * @create: 2019-11-05 10:57
 **/
@Path("/z001/workflow")
public class Test extends HttpServlet {
    @POST
    @Path("/getmessage")
    @Produces(MediaType.TEXT_PLAIN)
    public String getDisButton(@Context HttpServletRequest request, @Context HttpServletResponse response, JSONObject json) {
        RecordSet rs = new RecordSet();
        BaseBean bb = new BaseBean();
        String cwxx1 = bb.getPropValue("hourApprove", "cwxx1");
        bb.writeLog("进入测试");
        String requestid = Util.null2String(request.getParameter("requestid"));
        bb.writeLog("requestid==" + requestid);
        String workflowid = Util.null2String(request.getParameter("workflowid"));
        String sql = "select * from workflow_requestbase where requestid='" + requestid + "'";
        rs.execute(sql);
        String currentNodeid = "";
        if (rs.next()) {
            currentNodeid = Util.null2String(rs.getString("currentnodeid"));
        }
        return currentNodeid;
    }

}
